home *** CD-ROM | disk | FTP | other *** search
- Path: in2.uu.net!zdc!szdc!news
- From: braz@ime.usp.br (Rodrigo de Salvo Braz)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP with a simple C Structure
- Date: Mon, 15 Apr 1996 17:05:11 GMT
- Organization: Zippo
- Message-ID: <4ku0v4$lg3@clark.zippo.com>
- References: <4jm38u$j1a@news.bellglobal.com>
- NNTP-Posting-Host: ddata116.dialdata.com.br
- X-Newsreader: Forte Free Agent 1.0.82
-
- >struct Employee
- > {
- > float salary;
- > char department;
- > }
-
- >Employee Jim, Paul, Pat, Scott;
-
- >void main(void)
- > {
- > Jim.salary=15;
- > Paul.salary=14;
- > Pat.salary=13;
- > Scott.salary=12;
-
- > Jim.department='a';
- > Paul.department='b';
- > Pat.department='c';
- > Scott.department='b';
- > ................................
- > }
-
- >I need to replace the dots with a program that tells me who else works
- >in Paul's department and how much money he makes.
-
- >I would like to have the structure variables named with the name of
- >the employee, (instead of an array with the name of the employee as a
- >member) so I can easily access their members. The structure can be
- >modified, but I really need to be able to have expressions such as
- >Jim.salary.
-
- >Thank you,
- >Bogdan Florescu
-
-
- knowing how much he gets seems trivial, just access .salary.
-
- A function which tells you who else works there should receive
- an employee and some kind of data structure containing ALL
- workers, so the function could browse it and compare .department.
-
- Cheers,
-
- Rodrigo Braz
-
-
-